<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/header::commonHeader('主页')">
<body class="nav-md">
<div class="container body">
    <div class="main_container">
        <div th:include="/common/menu::commonMenu"></div>
        <div th:include="/common/nav::commonNav"></div>
        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_content">
                                <br>
                                <form id="plateSearchForm" th:action="@{/plate/list}" data-parsley-validate="" class="form-horizontal form-label-left"
                                      novalidate="" onsubmit="return false">
                                    <div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">
                                        <input type="text" class="form-control col-md-4 col-xs-4" name="keyword"
                                               placeholder="请输入查询板块名称关键字">
                                    </div>
                                    <div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">
                                        <button class="btn btn-primary" type="button" onclick="$c.dataTableSearch(plateTable,'plateSearchForm')">搜索</button>
                                        <button class="btn btn-success" type="button" onclick="addPlate()">新增</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div th:include="/common/table/tool::commonTableTool('博文板块', 'Plates')"></div>
                            <div th:include="/plate/table::noramlList('plateTable')"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<footer th:include="/common/footer::commonFooter"></footer>
</body>
<script>
    const plateTable = $c.dataTableV2('plateTable', '[[@{/plate/list}]]', columns)
    let plateEditDialog, plateAddDialog;
    function editPlate(id) {
        plateEditDialog = $c.dialog('类别编辑', '[[@{/plate/edit}]]?id=' + id, '50%')
    }
    function addPlate() {
        plateAddDialog = $c.dialog('分类添加', '[[@{/plate/add.html}]]', '50%')
    }
    function delPlate(id) {
        $c.delRecord("确定删除该类别", '[[@{/plate/del?id=}]]' + id, plateTable);
    }
</script>
</html>
